package org.idea.spring.look.up.factory;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author linhao
 * @Date created in 9:26 下午 2021/4/10
 */
@Configuration
public class Config {

    public class Pig{
        int id;

        public Pig() {
            System.out.println("this is pig");
        }

        @Override
        public String toString() {
            return "Pig{" +
                    "id=" + id +
                    '}';
        }
    }

    @Bean(name = "pig")
    public Pig getPig(){
        return new Pig();
    }
}
